/**
 * Created by zengxm on 12/26/2016.
 */
const Client=require("../service/service.ssh")

var ssh=Client.connect({
    ip:"192.168.1.131",
    port:20022,
    user:"root",
    password:"root"
},()=>{
    console.log("connect ok~")

    ssh.execCommand("ls",{cwd:"/mnt/test"}).then((result)=>{
        console.log(result);
        //下载数据
        ssh.getFile('/mnt/test/8_133929_20161226', 'D:/8_133929_20161226').then(function(Contents) {
            console.log("The File's contents were successfully downloaded")

            ssh.dispose()
        }, function(error) {
            console.log("Something's wrong")
            console.log(error)
            ssh.dispose()
        })
    })
})